package cn.edu.swufe.surverpark.struts2.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.edu.swufe.surverpark.model.Log;
import cn.edu.swufe.surverpark.struts2.service.LogService;
import cn.edu.swufe.surverpark.util.StringUtil;

/**
 *@author 陈龙 E-mail:529914446@qq.com
 *@version创建时间:2015年5月7日上午5:01:41
 *类说明
 */
@Controller
@Scope("prototype")
public class LogAction extends BaseAction<Log> {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6959988039362193346L;

	@Resource
	private LogService logService;
	private List<Log> logs;
	private int monthNum;
	
	public String findNearestLogs(){
		if(monthNum <= 0)
			monthNum = 1;
		this.logs = logService.findNearestLogs(monthNum);
		return "logListPage";
	}
	public List<Log> getLogs() {
		return logs;
	}
	public void setLogs(List<Log> logs) {
		this.logs = logs;
	}
	public String getString(String str){
		return StringUtil.getDescString(str);
	}
	public int getMonthNum() {
		return monthNum;
	}
	public void setMonthNum(int monthNum) {
		this.monthNum = monthNum;
	}
	
}

